<template>
  <pt-dialog :visible.sync="visible" title="编辑" width='70%'>
    <!--gridThis是ptcomgrid的this,这里有sync-->
    <pt-form :model.sync="ptform" label-width="120px" ref="ptform">
      <el-row>
        <pt-btn icon="fa fa-question-circle-o" style="float: right;font-size: 30px">
          <div slot="content" style="font-size: large">
            <li>弹窗可以双击全屏</li>
            <li>弹窗可拖动,向上越界限制</li>
            <li>加了很多重复form方便测试</li>
            <li>校验显示</li>
            <li>pt-form的与pt-com-grid的联动:修改只更新当条数据,新增,自动加在头部</li>
            <li>pt-form的保存</li>
            <li>在分辨率变小时,el-row的响应式布局</li>
          </div>
        </pt-btn>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="普通下拉" prop="dropCode">
            <PtDrop field="DEMO_DROP" v-model="ptform.dropCode"></PtDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(1)" label="列表下拉" prop="dropGridId">
            <!-- 注意冒号-->
            <UserTableDrop :idVal.sync="ptform.dropGridId" :txtVal.sync="ptform.dropGridStr"></UserTableDrop>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0)" label="时间" prop="dateTime">
            <el-date-picker v-bind="$time" v-model="ptform.dateTime"
            ></el-date-picker>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,3,10)" label="文本(3-10字符)" prop="name">
            <el-input type="text" v-model="ptform.name"></el-input>
          </pt-form-item>
        </el-col>
        <el-col :span="8" :xs="24">
          <pt-form-item :rules="$r(0,0,999999,'number',2)" label="数字(2位小数)" prop="sorter">
            <pt-num v-model="ptform.sorter"></pt-num>
          </pt-form-item>
        </el-col>
      </el-row>
    </pt-form>
    <div class="dialog-footer" slot="footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button :loading="loading" @click="submit" type="primary"> 确 定</el-button>
    </div>
  </pt-dialog>

</template>

<script>
  import UserTableDrop from './UserTableDrop'

  export default {
    name: 'ptdemotableform',
    components: {UserTableDrop},
    data() {
      return {
        ptform: {},
        visible: false,
        tsLoading: false,
        loading: false

      }
    },
    methods: {
      show(row, gridThis) { //列表与PtForm存在耦合依赖,PtForm获取列表的ptQuery及url
        this.visible = true
        // this.gridThis.ptQuery.query.parentId = parentId,传值到后台的写法,主从表会用到
        this.$nextTick(() => {
          if (row) {
            this.$refs.ptform.edit(row, gridThis)// form编辑时,不走后台,也可传null,这样走后台findOne(PtQuery query),但是需要给his.gridThis.ptQuery.query.pkId 赋值
          } else {
            this.$refs.ptform.add(null, gridThis)// 新增,走后台findOne(PtQuery query)
          }
        })
      },
      submit() {
        this.$refs.ptform.save().then(() => {//then为回调
          this.visible = false
        })
      }
    }
  }
</script>

